$.templates({
    userButtons:"<div class='button summary'> Summary </div>" + 
                "{{for users}}"+
                    "<div class='button user {{>selected}}' data='{{>name}}'>{{>name}} <span class='points'> {{>sum}} </span></div>"+
                "{{else}}" +
                    "<div class='button selected'><a href='#'> Setup </a></div>" +
                "{{/for}}" +
                "<div class='button result'>Result</div>" + 
                "<div class='button adduser'><a href='#'> Add user </a></div>",
        
    pointSelection : "<h1 class='title'>Planning Poker</h1>" +
                "<div class='center point' id='point'>X</div>" + 
                "<div class='center tip'>Story points</div>" +
                "<div class='center bigtip'>&lt;- Use the arrow buttons or click to change score -&gt;</div>" +
                "<div class='center tip'>Tip: Touch device? Touch left or right side</div>" +
                "<div class='center bigtip'>Use the space buttons accept</div>",
        
    subjectSelection : "<h1 class='title'>Select Subject</h1>" +
                "<ul>"+
                    "{{for subjects}}" +
                        //"<div>" +
                            "<div class='button subject {{>selected}}' data='{{>title}}'>{{>title}} "+
                                "<span class='points'> {{>sum}} </span>"+
                            "</div>"+
                        //"</div>" +
                    "{{else}}" +
                        //"<div>" +
                            "<div class='selected'>No Subjects</div>" +
                        //"</div>" +
                    "{{/for}}" +
                "</ul>" +
                "<div class='button addsubject'><a href='#'>Add subject</a></div>" + 
                "<h1  class='title'>Results</h1>" +
                "<p class='total'>{{>total}}</p>" + 
                "<small class='total'>( 1 storypoint = 8 man-hours = 1 man-day )</small>"
});

//checks if it isn't implemented yet
if (!String.prototype.format) {
  String.prototype.format = function() {
    var args = arguments;
    return this.replace(/{(\d+)}/g, function(match, number) { 
      return typeof(args[number]) !== 'undefined'
        ? args[number]
        : match
      ;
    });
  };
}

